package certificates

import (
	"context"

	"gitee.com/djaf/my-certs/app/data/dxo"
	"gitee.com/djaf/my-certs/app/web/dto"
	"github.com/starter-go/rbac"
)

// Query ...
type Query struct {
	Pagination rbac.Pagination
	Domain     string
}

// Service : Service for Certs
type Service interface {
	Insert(ctx context.Context, obj *dto.Certificate) (*dto.Certificate, error)

	Find(ctx context.Context, id dxo.CertificateID) (*dto.Certificate, error)

	List(ctx context.Context, q *Query) ([]*dto.Certificate, error)
}

// CSRService ...
type CSRService interface {
	NewRequest(ctx context.Context, req *dto.CSR) error

	GetState(ctx context.Context, req *dto.CSR) error

	UpdateState(ctx context.Context, req *dto.CSR) error

	Cancel(ctx context.Context, req *dto.CSR) error
}
